<?php
session_start();
if ($_SESSION['connecte']==1)
{
	require_once ("../baniere.php");

	if (isset($_GET['num'])) {
		$link = mysql_connect(HOST,USER,PASS);
		mysql_select_db(BASE, $link);
		$num = $_GET['num'];
		$query = 'select * from FAMILLE f, AGE a, LOGEMENT l, ORGANISME o, RESSOURCE r, SITUATION s, CIVILITE c
			WHERE noFamille='.$num.
			' AND l.noLogement=f.logement
			AND o.noOrganisme=f.organisme
			AND r.noRessource=f.ressource
			AND s.noSituation=f.situation
			AND a.noAge=f.age
			AND c.noCivilite=f.civilite;';

		$result = mysql_query($query,$link) or die("Erreur connection sql");
		$val=mysql_fetch_array($result);

		//$date=dateInverse($val['dateNaissanceAdherent']);
		echo"<table>";
		echo "<tr><td>Civilit&eacute; : </td><td>".$val['libelleCivilite']."</td></tr>";
		echo "<tr><td>Nom : </td><td>".$val['nom']."</td></tr>";
		echo "<tr><td>Prenom : </td><td>".$val['prenom']."</td></tr>";
		echo "<tr><td>Date d'inscription : </td><td>".dateInverseSortie($val['dateInscription'])."</td></tr>";
		echo "<tr><td>Adresse : </td><td>".$val['adresse']."</td></tr>";
		echo "<tr><td>Ville : </td><td>".$val['ville']."</td></tr>";
		echo "<tr><td>Numero de t&eacute;l&eacute;phone : </td><td>".$val['telephone']."</td></tr>";
		echo "<tr><td>Age : </td><td>".$val['libelleAge']."</td></tr>";
		echo "<tr><td>Situation : </td><td>".$val['libelleSituation']."</td></tr>";
		echo "<tr><td>Ressource : </td><td>".$val['libelleRessource']."</td></tr>";
		echo "<tr><td>R&eacute;f&eacute;rent : </td><td>".$val['libelleOrganisme']."</td></tr>";
		echo "<tr><td>Logement : </td><td>".$val['libelleLogement']."</td></tr>";
		echo"</table>";

		print "<br/><a href=\"famille/liste.php\">Retour à la liste des familles</a>";
	}
}
else
{
	print "Vous devez vous connecter avant tout :  <a href=\"../index.php\">Se connecter </a>";
}
?>
